Imports System
Imports System.Web

<ToolboxData("<{0}:Column runat=server></{0}:Column>")> _
Public Class Column
    Inherits Panel

    Private m_ctlDiv As New WebControls.WebControl(HtmlTextWriterTag.Div)

    Private m_sCssClass As String

    Public Sub New()
        MyBase.New()
    End Sub

    Public Overrides Property CssClass() As String
        Get
            Return m_sCssClass
        End Get
        Set(ByVal value As String)
            m_sCssClass = value
        End Set
    End Property

    Protected Overrides Sub CreateChildControls()
        MyBase.CreateChildControls()

        MyBase.CssClass = "Column"
        Style("float") = "left"

        With m_ctlDiv
            .Style("clear") = "left"
        End With

        ChildControlsCreated = True
    End Sub

    Private Sub Column_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        Controls.Add(m_ctlDiv)
        MyBase.CssClass += " " & m_sCssClass
    End Sub
End Class